version: '3.8'

name: itplanet-2

services:
  flask1:
    container_name: flask1
    hostname: flask1
    build: .
    expose:
      - 5001
    networks:
      - internal.network
    command: gunicorn --bind 0.0.0.0:5001 flask1.app:app
    
  flask2:
    container_name: flask2
    hostname: flask2
    build: .
    expose:
      - 5002
    networks:
      - internal.network
    command: gunicorn --bind 0.0.0.0:5002 flask2.app:app
  nginx:
    container_name: nginx
    hostname: nginx
    build: ./nginx/
    volumes:
      - ./nginx/nginx.conf:/etc/nginx/nginx.conf
    depends_on:
      - flask1
      - flask2
    expose:
      - 5000
    ports:
      - 5000:443
    networks:
      - default
      - internal.network

networks:
  default:
    driver: bridge
  internal.network:
    driver: bridge
    internal: true